#ifndef VERTEX_H
#define VERTEX_H

#include "defs.h"
#include "model/point.h"
#include "matrixtransformation.h"

#include <list>
#include <vector>

class HalfEdge;
class Face;
class Vertex: public Point{


    //-------------------------------------------------------------//
    //                          ATTRIBUTES                         //
    //-------------------------------------------------------------//

public:
    coord w;

    unsigned int index;

    HalfEdge *edge;

    //-------------------------------------------------------------//
    //                          METHODS                            //
    //-------------------------------------------------------------//

    Vertex( coord x = 0, coord y = 0, coord z = 0, coord w = 1, unsigned int index = 0);

    Vertex( const Vertex &vertex );

    Vertex( const Point &point );

    virtual ~Vertex();

    void apply(const MatrixTransformation &m);

    void updateValues(const Vertex &values);

    const std::list<const Face *> getFaces() const;

    const std::list<const Vertex *> getNeighbors() const;

    //-------------------------------------------------------------//
    //                          STATICS                            //
    //-------------------------------------------------------------//

    // TODO Mover ester método para o local correto
    static std::vector<HalfEdge *> join(const std::vector<Vertex *> &points);
};

#endif // VERTEX_H

